﻿/// <summary>
/// https://leetcode-cn.com/problems/reverse-integer/
/// </summary>
public class Solution
{
    public int Reverse(int x)
    {
        if (x == int.MinValue)
            return 0;
        return
            int.TryParse(new string(Math.Abs(x).ToString().Reverse().ToArray()), out var result) ?
            Math.Sign(x) * result : 0;
    }
}